In [1]:
import tensorflow as tf

In [2]:
import numpy as np

Example of Variable


In [3]:
with tf.Session() as sess:
    my_var = tf.Variable(tf.zeros([2,3]))
    initialize_op = tf.global_variables_initializer()
    sess.run(initialize_op)

Example of Placeholder


In [4]:
with tf.Session() as sess:
    x = tf.placeholder(tf.float32, shape=[2,3])
    y = tf.identity(x)
    x_vals = np.random.rand(2,3)
    sess.run(y, feed_dict={x :x_vals})

In [ ]: